package com.example.forum.services;

import com.example.forum.model.User;

/**
 * @author hanzishuai
 * @date 2025/3/22 16:33
 * @Description 用户接口
 */
public interface IUserService {

    /**
     * Created by hanzishuai on 2025/3/22
     *
     * @param user 用户信息
     * @Description 创建一个普通用户
     */
    void createNormalUser(User user);

    /**
     * Created by hanzishuai on 2025/3/22
     *
     * @param username 用户名
     * @return com.example.forum.model.User
     * @Description 根据用户名查询用户信息
     */
    User selectByUserName(String username);

    /**
     * Created by hanzishuai on 2025/3/22
     *
     * @param username 用户名
     * @param password 密码
     * @return com.example.forum.model.User
     * @Description
     */
    User login(String username, String password);

    /**
     * Created by hanzishuai on 2025/4/8
     *
     * @param id 用户 Id
     * @return com.example.forum.model.User
     * @Description 根据 Id 查询用户信息
     */
    User selectById(Long id);


    /**
     * Created by hanzishuai on 2025/4/9
     *
     * @param id 用户 Id
     * @Description 用户发帖数 + 1
     */
    void addOneArticleCountById(Long id);


    /**
     * Created by hanzishuai on 2025/4/12
     *
     * @param id 用户 Id
     * @Description 用户发帖数 - 1
     */
    void subOneArticleCountById(Long id);


    /**
     * Created by hanzishuai on 2025/4/12
     *
     * @param user 要更新的对象
     * @return void
     * @Description 修改个人信息
     */
    void modifyInfo(User user);


    /**
     * Created by hanzishuai on 2025/4/13
     *
     * @param id          用户 Id
     * @param newPassword 新密码
     * @param oldPassword 老密码
     * @return void
     * @Description
     */
    void modifyPassword(Long id, String newPassword, String oldPassword);
}






















